function CustomFileBrowser(field_name, url, type, win) {

    var cmsURL = "/admin/filebrowser/browse/?pop=2";
    cmsURL = cmsURL + "&type=" + type;
    
    tinyMCE.activeEditor.windowManager.open({
        file: cmsURL,
        width: 1000,  // Your dimensions may differ - toy around with them!
        height: 500,
        resizable: "yes",
        scrollbars: "yes",
        inline: "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
        close_previous: "no"
    }, {
        window: win,
        input: field_name,
        editor_id: tinyMCE.selectedInstance.editorId
    });
    return false;
}

tinyMCE.init({
    mode : "textareas",
    relative_urls: false, 
    language: "fr", 
    directionality: "ltr", 
    theme: "advanced",
    file_browser_callback: "CustomFileBrowser",
    spellchecker_languages: "Français=fr",
    plugins : "safari,contextmenu,advimage,table,fullscreen,paste,inlinepopups",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_blockformats : "p,h3,h4,h5,blockquote,dt,dd",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontsizeselect,|,forecolor,backcolor,|,bullist,numlist,|,outdent,indent,|,sub,sup,|,charmap,emotions",
    theme_advanced_buttons2 : "pastetext,pasteword,selectall,|,undo,redo,|,link,unlink,anchor,image,code,|,tablecontrols,|,fullscreen",
    theme_advanced_buttons3 : "",
    paste_auto_cleanup_on_paste : true,
    object_resizing: true,
    cleanup_on_startup: true,
    forced_root_block: "p",
    remove_trailing_nbsp: true
});
